# -*- coding:utf-8 -*-
class Solution:
    def FirstNotRepeatingChar(self, s):
        # write code here
        str_list = list(s)
        str_dict = dict()
        for char in str_list:
            if char in str_dict.keys():
                str_dict[char] += 1
            else:
                str_dict[char] = 1
        for i in range(len(str_list)):
            if str_dict[str_list[i]] == 1:

                return i
        return -1

# -*- coding:utf-8 -*-
class Solution:
    def FirstNotRepeatingChar(self, s):
        # write code here
        str_list = list(s)
        not_repeat = []
        num_repeate = []
        for char in str_list:
            if char in not_repeat:
                num_repeate[not_repeat.index(char)] += 1
            else:
                not_repeat.append(char)
                num_repeate.append(1)
        for (char, num) in zip(not_repeat, num_repeate):
            if num == 1:
                # print(char)
                return str_list.index(char)
        return -1
